// 图片服务
const IMAGE_API = 'https://api.52vmy.cn/api/img/tu/man'

export const imageService = {
	// 获取随机图片
	async getRandomImage() {
		try {
			const response = await uni.request({
				url: IMAGE_API,
				method: 'GET'
			})
			
			if (response.data.code === 200) {
				return response.data.url
			} else {
				throw new Error('获取图片失败')
			}
		} catch (error) {
			console.error('获取随机图片失败:', error)
			throw error
		}
	}
}